package com.rq.adapter;

import com.rq.rvlibrary.Compare;

import java.io.Serializable;

public class MoreData implements Compare, Serializable {
    public String name;
    public int age;

    public MoreData(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public boolean areItemsTheSame(Compare obj) {
        boolean res = obj instanceof MoreData && (name != null && name.equals(((MoreData) obj).name));
        return res;
    }

    @Override
    public boolean areContentsTheSame(Compare obj) {
        boolean res = obj instanceof MoreData && (name != null && name.equals(((MoreData) obj).name))
                && (age == (((MoreData) obj).age));
        return res;
    }

    @Override
    public String toString() {
        return "MoreData{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
